package com.Ling.Thread.sync;


import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * File Name: ExecutorDemp
 * Date: 2020-06-29 15:49
 * Author: liangling
 * Description
 */
public class ExecutorDemo {
    public static void main(String[] args) throws Exception {
        ExecutorService executorService  = Executors.newFixedThreadPool(2);

        MyCallable myCallable = new MyCallable();
        MyCallable myCallable1 = new MyCallable();

        executorService.submit(myCallable);
        executorService.submit(myCallable1);
//        executorService.execute(()->{
//            System.out.println(Thread.currentThread().getName()+"我是线程池");
//        });
        executorService.shutdown();

    }
}
